


<div class="row-fluid">
    <?php echo $this->render('/index/menu.phtml'); ?>


    <div class="well well-small">
         <h5>Juicios</h5>
      
        <form name="form_busqueda" class="noPrint" method="GET" action="<?php echo $this->baseUrl(); ?>/admin/listados/creditosporestado">
           
            <div class="row-fluid">
               
                <div class="control-group" style="margin-bottom:0px;display:inline-block;">
                    <label>Plan</label>
                    <select name="plan" class="input-small">
                        <option value="0" <?php echo $this->plan == 0? "selected" : "" ?>>Todos</option>
                        <option value="1" <?php echo $this->plan == 1? "selected" : "" ?>>STD</option>
                        <option value="2" <?php echo $this->plan == 2? "selected" : "" ?>>VBL</option>
                        <option value="3" <?php echo $this->plan == 3? "selected" : "" ?>>MNL</option>
                    </select>
                </div>
                <div class="control-group" style="margin-bottom:0px;display:inline-block;">
                    <label>Tipos</label>
                    <select name="tipo" class="input-medium">
                        <option value="0" <?php echo $this->tipo == 0 ? "selected" : "" ?>>Todos</option>
                        <option value="1" <?php echo $this->tipo == 1 ? "selected" : "" ?>>Nuevo</option>
                        <option value="2" <?php echo $this->tipo == 2 ? "selected" : "" ?>>Renovado</option>
                        <option value="3" <?php echo $this->tipo == 3 ? "selected" : "" ?>>Paralelo</option>
                        <option value="4" <?php echo $this->tipo == 4 ? "selected" : "" ?>>Reingreso</option>
                        <option value="6" <?php echo $this->tipo == 6 ? "selected" : "" ?>>Exclusivo</option>
                    </select>
                </div>
                <div class="control-group" style="margin-bottom:0px;display:inline-block;">
                    <label>Estados</label>
                    <select name="estado" class="input-medium">
                        <option value="todos" <?php echo $this->estado == "todos" ? "selected" : "" ?>>Todos</option>
                        <option value="activos" <?php echo $this->estado == "activos" ? "selected" : "" ?>>Activos</option>
                        <option value="cancelados" <?php echo $this->estado == "cancelados" ? "selected" : "" ?>>Cancelados</option>
                    </select>
                </div>
                <div class="control-group" style="display:inline-block;">
                    <input style="margin-bottom:8px;" class="btn" value="Buscar" type="submit" />
                </div>
            </div>
        </form>
        <div class="row-fluid ">
            <span>
            <?php
            switch ($this->estado) {
                case 'todos':
                    $subtitulo='<b>'.count($this->creditos).'</b> Creditos encontrados entre <b>'.$this->desde.'</b> a <b>'.$this->hasta.'</b>';
                    break;
               case 'activos':
                    $subtitulo='<b>'.count($this->creditos).'</b> Creditos <b>ACTIVOS</b> encontrados entre <b>'.$this->desde.'</b> a <b>'.$this->hasta.'</b>';
                    break;
                 case 'cancelados':
                    $subtitulo='<b>'.count($this->creditos).'</b> Creditos <b>CANCELADOS</b> encontrados entre <b>'.$this->desde.'</b> a <b>'.$this->hasta.'</b>';
                    break;
                default:
                    break;
            }
            echo  $subtitulo;
            ?>
            </span>
            <button type="button" onclick="PrintElement('#tabla_por_estados')" class="btn btn-inverse noPrint" style="float:right; margin:3px;"><i class=" icon-print icon-white"></i>  Imprimir</button>&nbsp;&nbsp;
            <table id="tabla_por_estados" class="tabla_reducida">
                <thead>
                <th>Usuario</th><th>Cliente</th><th>Capital</th><th>Juzgado</th><th>Nro Cuenta</th><th>1er Cobro</th><th>2do Cobro</th><th>3er Cobro</th><th>...</th><th>...</th></th>
                </thead>
                <tbody>
                    <tr>
                        <td>DANIEL</td>
                        <td>MANDOZI  MARCELO</td>
                        <td>4500</td>
                        <td>1</td>
                        <td>568630/7</td>
                        <td>$ 5710,5</td>
                        <td> </td>
                        <td> </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>


<script type="text/javascript">
    
    $(document).ready(function() {
        $("#tabla_por_estados").chromatable({
            width: "100%",  
            height: "350px",
            scrolling: "yes"
        });
        
    });
</script>

<script type="text/javascript">
    //Simple wrapper to pass a jQuery object to your new window
    function PrintElement(elem){
        Popup($(elem).html());
    }

    //Creates a new window and populates it with your content
    function Popup(data) {
        //Create your new window
        var w = window.open('', 'Creditos <?php echo $this->desde ?> - <?php echo $this->hasta ?>', 'height=600,width=800');
        w.document.write('<html><head><title>Creditos <?php echo $this->desde ?> - <?php echo $this->hasta ?></title>');
        //Include your stylesheet (optional)
        w.document.write('<link rel="stylesheet" href="<?php echo $this->baseUrl("/bootstrap/css/bootstrap.css") ?>" type="text/css" />');
        w.document.write('</head><body>');
        w.document.write('<h2>Creditos <?php echo $this->desde ?> - <?php echo $this->hasta ?></h2>');
        //Write your content
        w.document.write("<table class='table table-bordered'>"+data+"</table>");
        w.document.write('</body></html>');
        w.print();
        w.close();

        return true;
    }
</script>